#pragma once


#include "qwindow.h"
#include "qtoolbar.h"


namespace micro{
namespace gui{

class QReBar: public QWindow
{
public:
	QReBar(void);
public:
	virtual ~QReBar(void);
	virtual bool Create(QWindow* parent, int id=0, UINT style=0);

protected:
	virtual bool	OnSize(int type, int cx,int cy);

public:
  bool SetBarInfo(LPREBARINFO barInfo)					{ return toBool(SendMessage(RB_SETBARINFO, 0, (LPARAM)barInfo)); }
  bool InsertBand(int index, LPREBARBANDINFO bandInfo)  { return toBool(SendMessage(RB_INSERTBAND, index, (LPARAM)bandInfo)); }
  bool SetBandInfo(int index, LPREBARBANDINFO bandInfo) { return toBool(SendMessage(RB_SETBANDINFO, index, (LPARAM)bandInfo)); }
  void MaximizeBand(int index, bool ideal)				{ SendMessage(RB_MAXIMIZEBAND, index, toBOOL(ideal)); }
  bool SizeToRect(LPRECT rect)							{ return toBool(SendMessage(RB_SIZETORECT, 0, (LPARAM)rect)); }
  UINT GetHeight() { return SendMessage(RB_GETBARHEIGHT); }
  UINT GetBandCount(){ return (UINT)SendMessage(RB_GETBANDCOUNT); }
  bool DeleteBand(UINT index) { return toBool(SendMessage(RB_DELETEBAND, index)); }


public:
	
	bool AddBand(QToolBar &toolBar,int iID, UINT style=RBBS_FIXEDSIZE);
};

}
}//micro